package com.tensquare.entity;

import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data;
import org.codehaus.jackson.map.annotate.JsonSerialize;
import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion;

@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
public class Result {

    private boolean flag;

    private Integer code;

    private String message;

    @JsonSerialize(include = Inclusion.NON_NULL)
    private Object data;

    public Result() {}

    public Result(boolean flag, Integer code) {
        this.flag = flag;
        this.code = code;
    }

    public Result(boolean flag, Integer code, String message) {
        this.flag = flag;
        this.code = code;
        this.message = message;
    }

    public Result(boolean flag, Integer code, String message, Object data) {
        this.flag = flag;
        this.code = code;
        this.message = message;
        this.data = data;
    }

}
